stylecontext: Don't emit state warning for transient nodes
authorBenjamin Otte <otte@redhat.com>
Tue, 1 Dec 2015 23:26:16 +0000 (00:26 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 1 Dec 2015 23:29:36 +0000 (00:29 +0100)
It's fine to call set_state() on those.

https://bugzilla.gnome.org/show_bug.cgi?id=758930

gtk/gtkstylecontext.c

index 4a5c343527a307b5d35b35732ccbbdad77944eb7..dbaa4d068b591e58fc3d1f0d4136f205772235eb 100644 (file)
@@ -499,7 +499,11 @@ gtk_style_context_push_state (GtkStyleContext *context,
 
   root = gtk_style_context_get_root (context);
 
-  if (GTK_IS_CSS_WIDGET_NODE (root))
+  if (GTK_IS_CSS_TRANSIENT_NODE (priv->cssnode))
+    {
+      /* don't emit a warning, changing state here is fine */
+    }
+  else if (GTK_IS_CSS_WIDGET_NODE (root))
     {
       GtkWidget *widget = gtk_css_widget_node_get_widget (GTK_CSS_WIDGET_NODE (root));
       g_warning ("State %u for %s %p doesn't match state %u set via gtk_style_context_set_state ()",